package org.chameleon.limit.convert;

import com.alibaba.fastjson.JSON;
import org.chameleon.datasource.convert.AbstractConverter;
import org.chameleon.limit.entity.RateLimiterConfig;


public class JzConfLimitConvert extends AbstractConverter<String , RateLimiterConfig> {
    public JzConfLimitConvert( ) {
        super(source-> {
            final RateLimiterConfig rateLimiterConfig = JSON.parseObject(source, RateLimiterConfig.class);
            return rateLimiterConfig;
        },source->JSON.toJSONString(source));
    }
}
